3.5.40 \(\int \frac {(a+a \sin (e+f x))^2}{(c+d \sin (e+f x))^2} \, dx\) [440]

Optimal. Leaf size=112 \[ \frac {a^2 x}{d^2}-\frac {2 a^2 (c-d)^2 (c+2 d) \tan ^{-1}\left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{d^2 \left (c^2-d^2\right )^{3/2} f}+\frac {a^2 (c-d) \cos (e+f x)}{d (c+d) f (c+d \sin (e+f x))} \]

[Out]

a^2*x/d^2-2*a^2*(c-d)^2*(c+2*d)*arctan((d+c*tan(1/2*f*x+1/2*e))/(c^2-d^2)^(1/2))/d^2/(c^2-d^2)^(3/2)/f+a^2*(c-
d)*cos(f*x+e)/d/(c+d)/f/(c+d*sin(f*x+e))

________________________________________________________________________________________

Rubi [A]
time = 0.13, antiderivative size = 115, normalized size of antiderivative = 1.03, number of steps used = 5, number of rules used = 5, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {2841, 2814, 2739, 632, 210} \begin {gather*} -\frac {2 a^2 (c-d) (c+2 d) \text {ArcTan}\left (\frac {c \tan \left (\frac {1}{2} (e+f x)\right )+d}{\sqrt {c^2-d^2}}\right )}{d^2 f (c+d) \sqrt {c^2-d^2}}+\frac {a^2 (c-d) \cos (e+f x)}{d f (c+d) (c+d \sin (e+f x))}+\frac {a^2 x}{d^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + a*Sin[e + f*x])^2/(c + d*Sin[e + f*x])^2,x]

[Out]

(a^2*x)/d^2 - (2*a^2*(c - d)*(c + 2*d)*ArcTan[(d + c*Tan[(e + f*x)/2])/Sqrt[c^2 - d^2]])/(d^2*(c + d)*Sqrt[c^2
 - d^2]*f) + (a^2*(c - d)*Cos[e + f*x])/(d*(c + d)*f*(c + d*Sin[e + f*x]))

Rule 210

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[-b, 2])^(-1))*ArcTan[Rt[-b, 2]*(x/Rt[-a, 2])
], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 632

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 2739

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x]}, Dis
t[2*(e/d), Subst[Int[1/(a + 2*b*e*x + a*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] &&
 NeQ[a^2 - b^2, 0]

Rule 2814

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*(x/d)
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rule 2841

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim
p[(-b^2)*(b*c - a*d)*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m - 2)*((c + d*Sin[e + f*x])^(n + 1)/(d*f*(n + 1)*(b*c
 + a*d))), x] + Dist[b^2/(d*(n + 1)*(b*c + a*d)), Int[(a + b*Sin[e + f*x])^(m - 2)*(c + d*Sin[e + f*x])^(n + 1
)*Simp[a*c*(m - 2) - b*d*(m - 2*n - 4) - (b*c*(m - 1) - a*d*(m + 2*n + 1))*Sin[e + f*x], x], x], x] /; FreeQ[{
a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && GtQ[m, 1] && LtQ[n, -1
] && (IntegersQ[2*m, 2*n] || IntegerQ[m + 1/2] || (IntegerQ[m] && EqQ[c, 0]))

Rubi steps

\begin {align*} \int \frac {(a+a \sin (e+f x))^2}{(c+d \sin (e+f x))^2} \, dx &=\frac {a^2 (c-d) \cos (e+f x)}{d (c+d) f (c+d \sin (e+f x))}-\frac {a \int \frac {-2 a d-a (c+d) \sin (e+f x)}{c+d \sin (e+f x)} \, dx}{d (c+d)}\\ &=\frac {a^2 x}{d^2}+\frac {a^2 (c-d) \cos (e+f x)}{d (c+d) f (c+d \sin (e+f x))}-\frac {\left (a^2 (c-d) (c+2 d)\right ) \int \frac {1}{c+d \sin (e+f x)} \, dx}{d^2 (c+d)}\\ &=\frac {a^2 x}{d^2}+\frac {a^2 (c-d) \cos (e+f x)}{d (c+d) f (c+d \sin (e+f x))}-\frac {\left (2 a^2 (c-d) (c+2 d)\right ) \text {Subst}\left (\int \frac {1}{c+2 d x+c x^2} \, dx,x,\tan \left (\frac {1}{2} (e+f x)\right )\right )}{d^2 (c+d) f}\\ &=\frac {a^2 x}{d^2}+\frac {a^2 (c-d) \cos (e+f x)}{d (c+d) f (c+d \sin (e+f x))}+\frac {\left (4 a^2 (c-d) (c+2 d)\right ) \text {Subst}\left (\int \frac {1}{-4 \left (c^2-d^2\right )-x^2} \, dx,x,2 d+2 c \tan \left (\frac {1}{2} (e+f x)\right )\right )}{d^2 (c+d) f}\\ &=\frac {a^2 x}{d^2}-\frac {2 a^2 (c-d) (c+2 d) \tan ^{-1}\left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{d^2 (c+d) \sqrt {c^2-d^2} f}+\frac {a^2 (c-d) \cos (e+f x)}{d (c+d) f (c+d \sin (e+f x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.33, size = 139, normalized size = 1.24 \begin {gather*} \frac {a^2 (1+\sin (e+f x))^2 \left (e+f x-\frac {2 \left (c^2+c d-2 d^2\right ) \tan ^{-1}\left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{(c+d) \sqrt {c^2-d^2}}+\frac {(c-d) d \cos (e+f x)}{(c+d) (c+d \sin (e+f x))}\right )}{d^2 f \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^4} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + a*Sin[e + f*x])^2/(c + d*Sin[e + f*x])^2,x]

[Out]

(a^2*(1 + Sin[e + f*x])^2*(e + f*x - (2*(c^2 + c*d - 2*d^2)*ArcTan[(d + c*Tan[(e + f*x)/2])/Sqrt[c^2 - d^2]])/
((c + d)*Sqrt[c^2 - d^2]) + ((c - d)*d*Cos[e + f*x])/((c + d)*(c + d*Sin[e + f*x]))))/(d^2*f*(Cos[(e + f*x)/2]
 + Sin[(e + f*x)/2])^4)

________________________________________________________________________________________

Maple [A]
time = 0.47, size = 160, normalized size = 1.43

method result size
derivativedivides \(\frac {2 a^{2} \left (-\frac {\frac {-\frac {d^{2} \left (c -d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\left (c +d \right ) c}-\frac {d \left (c -d \right )}{c +d}}{c \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+2 d \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+c}+\frac {\left (c^{2}+c d -2 d^{2}\right ) \arctan \left (\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 d}{2 \sqrt {c^{2}-d^{2}}}\right )}{\left (c +d \right ) \sqrt {c^{2}-d^{2}}}}{d^{2}}+\frac {\arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{d^{2}}\right )}{f}\) \(160\)
default \(\frac {2 a^{2} \left (-\frac {\frac {-\frac {d^{2} \left (c -d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\left (c +d \right ) c}-\frac {d \left (c -d \right )}{c +d}}{c \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+2 d \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+c}+\frac {\left (c^{2}+c d -2 d^{2}\right ) \arctan \left (\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 d}{2 \sqrt {c^{2}-d^{2}}}\right )}{\left (c +d \right ) \sqrt {c^{2}-d^{2}}}}{d^{2}}+\frac {\arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{d^{2}}\right )}{f}\) \(160\)
risch \(\frac {a^{2} x}{d^{2}}-\frac {2 i a^{2} \left (c -d \right ) \left (i d +c \,{\mathrm e}^{i \left (f x +e \right )}\right )}{d^{2} \left (c +d \right ) f \left (-i d \,{\mathrm e}^{2 i \left (f x +e \right )}+i d +2 c \,{\mathrm e}^{i \left (f x +e \right )}\right )}+\frac {\sqrt {-\left (c +d \right ) \left (c -d \right )}\, a^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c -\sqrt {-\left (c +d \right ) \left (c -d \right )}}{d}\right ) c}{\left (c +d \right )^{2} f \,d^{2}}+\frac {2 \sqrt {-\left (c +d \right ) \left (c -d \right )}\, a^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c -\sqrt {-\left (c +d \right ) \left (c -d \right )}}{d}\right )}{\left (c +d \right )^{2} f d}-\frac {\sqrt {-\left (c +d \right ) \left (c -d \right )}\, a^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c +\sqrt {-\left (c +d \right ) \left (c -d \right )}}{d}\right ) c}{\left (c +d \right )^{2} f \,d^{2}}-\frac {2 \sqrt {-\left (c +d \right ) \left (c -d \right )}\, a^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c +\sqrt {-\left (c +d \right ) \left (c -d \right )}}{d}\right )}{\left (c +d \right )^{2} f d}\) \(325\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+a*sin(f*x+e))^2/(c+d*sin(f*x+e))^2,x,method=_RETURNVERBOSE)

[Out]

2/f*a^2*(-1/d^2*((-d^2*(c-d)/(c+d)/c*tan(1/2*f*x+1/2*e)-d*(c-d)/(c+d))/(c*tan(1/2*f*x+1/2*e)^2+2*d*tan(1/2*f*x
+1/2*e)+c)+(c^2+c*d-2*d^2)/(c+d)/(c^2-d^2)^(1/2)*arctan(1/2*(2*c*tan(1/2*f*x+1/2*e)+2*d)/(c^2-d^2)^(1/2)))+1/d
^2*arctan(tan(1/2*f*x+1/2*e)))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(f*x+e))^2/(c+d*sin(f*x+e))^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*d^2-4*c^2>0)', see `assume?`
 for more de

________________________________________________________________________________________

Fricas [A]
time = 0.37, size = 493, normalized size = 4.40 \begin {gather*} \left [\frac {2 \, {\left (a^{2} c d + a^{2} d^{2}\right )} f x \sin \left (f x + e\right ) + 2 \, {\left (a^{2} c^{2} + a^{2} c d\right )} f x + {\left (a^{2} c^{2} + 2 \, a^{2} c d + {\left (a^{2} c d + 2 \, a^{2} d^{2}\right )} \sin \left (f x + e\right )\right )} \sqrt {-\frac {c - d}{c + d}} \log \left (\frac {{\left (2 \, c^{2} - d^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, c d \sin \left (f x + e\right ) - c^{2} - d^{2} + 2 \, {\left ({\left (c^{2} + c d\right )} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + {\left (c d + d^{2}\right )} \cos \left (f x + e\right )\right )} \sqrt {-\frac {c - d}{c + d}}}{d^{2} \cos \left (f x + e\right )^{2} - 2 \, c d \sin \left (f x + e\right ) - c^{2} - d^{2}}\right ) + 2 \, {\left (a^{2} c d - a^{2} d^{2}\right )} \cos \left (f x + e\right )}{2 \, {\left ({\left (c d^{3} + d^{4}\right )} f \sin \left (f x + e\right ) + {\left (c^{2} d^{2} + c d^{3}\right )} f\right )}}, \frac {{\left (a^{2} c d + a^{2} d^{2}\right )} f x \sin \left (f x + e\right ) + {\left (a^{2} c^{2} + a^{2} c d\right )} f x + {\left (a^{2} c^{2} + 2 \, a^{2} c d + {\left (a^{2} c d + 2 \, a^{2} d^{2}\right )} \sin \left (f x + e\right )\right )} \sqrt {\frac {c - d}{c + d}} \arctan \left (-\frac {{\left (c \sin \left (f x + e\right ) + d\right )} \sqrt {\frac {c - d}{c + d}}}{{\left (c - d\right )} \cos \left (f x + e\right )}\right ) + {\left (a^{2} c d - a^{2} d^{2}\right )} \cos \left (f x + e\right )}{{\left (c d^{3} + d^{4}\right )} f \sin \left (f x + e\right ) + {\left (c^{2} d^{2} + c d^{3}\right )} f}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(f*x+e))^2/(c+d*sin(f*x+e))^2,x, algorithm="fricas")

[Out]

[1/2*(2*(a^2*c*d + a^2*d^2)*f*x*sin(f*x + e) + 2*(a^2*c^2 + a^2*c*d)*f*x + (a^2*c^2 + 2*a^2*c*d + (a^2*c*d + 2
*a^2*d^2)*sin(f*x + e))*sqrt(-(c - d)/(c + d))*log(((2*c^2 - d^2)*cos(f*x + e)^2 - 2*c*d*sin(f*x + e) - c^2 -
d^2 + 2*((c^2 + c*d)*cos(f*x + e)*sin(f*x + e) + (c*d + d^2)*cos(f*x + e))*sqrt(-(c - d)/(c + d)))/(d^2*cos(f*
x + e)^2 - 2*c*d*sin(f*x + e) - c^2 - d^2)) + 2*(a^2*c*d - a^2*d^2)*cos(f*x + e))/((c*d^3 + d^4)*f*sin(f*x + e
) + (c^2*d^2 + c*d^3)*f), ((a^2*c*d + a^2*d^2)*f*x*sin(f*x + e) + (a^2*c^2 + a^2*c*d)*f*x + (a^2*c^2 + 2*a^2*c
*d + (a^2*c*d + 2*a^2*d^2)*sin(f*x + e))*sqrt((c - d)/(c + d))*arctan(-(c*sin(f*x + e) + d)*sqrt((c - d)/(c +
d))/((c - d)*cos(f*x + e))) + (a^2*c*d - a^2*d^2)*cos(f*x + e))/((c*d^3 + d^4)*f*sin(f*x + e) + (c^2*d^2 + c*d
^3)*f)]

________________________________________________________________________________________

Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(f*x+e))**2/(c+d*sin(f*x+e))**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]
time = 0.45, size = 205, normalized size = 1.83 \begin {gather*} \frac {\frac {{\left (f x + e\right )} a^{2}}{d^{2}} - \frac {2 \, {\left (a^{2} c^{2} + a^{2} c d - 2 \, a^{2} d^{2}\right )} {\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (c\right ) + \arctan \left (\frac {c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + d}{\sqrt {c^{2} - d^{2}}}\right )\right )}}{{\left (c d^{2} + d^{3}\right )} \sqrt {c^{2} - d^{2}}} + \frac {2 \, {\left (a^{2} c d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - a^{2} d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + a^{2} c^{2} - a^{2} c d\right )}}{{\left (c^{2} d + c d^{2}\right )} {\left (c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 2 \, d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + c\right )}}}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(f*x+e))^2/(c+d*sin(f*x+e))^2,x, algorithm="giac")

[Out]

((f*x + e)*a^2/d^2 - 2*(a^2*c^2 + a^2*c*d - 2*a^2*d^2)*(pi*floor(1/2*(f*x + e)/pi + 1/2)*sgn(c) + arctan((c*ta
n(1/2*f*x + 1/2*e) + d)/sqrt(c^2 - d^2)))/((c*d^2 + d^3)*sqrt(c^2 - d^2)) + 2*(a^2*c*d*tan(1/2*f*x + 1/2*e) -
a^2*d^2*tan(1/2*f*x + 1/2*e) + a^2*c^2 - a^2*c*d)/((c^2*d + c*d^2)*(c*tan(1/2*f*x + 1/2*e)^2 + 2*d*tan(1/2*f*x
 + 1/2*e) + c)))/f

________________________________________________________________________________________

Mupad [B]
time = 11.24, size = 2836, normalized size = 25.32 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*sin(e + f*x))^2/(c + d*sin(e + f*x))^2,x)

[Out]

((2*(a^2*c - a^2*d))/(d*(c + d)) + (2*a^2*tan(e/2 + (f*x)/2)*(c - d))/(c*(c + d)))/(f*(c + 2*d*tan(e/2 + (f*x)
/2) + c*tan(e/2 + (f*x)/2)^2)) + (2*a^2*atan((192*a^6*c^3*d*tan(e/2 + (f*x)/2))/((128*a^6*c^3*d^5)/(2*c*d^3 +
d^4 + c^2*d^2) - (512*a^6*c^2*d^6)/(2*c*d^3 + d^4 + c^2*d^2) - (320*a^6*c*d^7)/(2*c*d^3 + d^4 + c^2*d^2) + (51
2*a^6*c^4*d^4)/(2*c*d^3 + d^4 + c^2*d^2) + (192*a^6*c^5*d^3)/(2*c*d^3 + d^4 + c^2*d^2)) - (320*a^6*c*d^3*tan(e
/2 + (f*x)/2))/((128*a^6*c^3*d^5)/(2*c*d^3 + d^4 + c^2*d^2) - (512*a^6*c^2*d^6)/(2*c*d^3 + d^4 + c^2*d^2) - (3
20*a^6*c*d^7)/(2*c*d^3 + d^4 + c^2*d^2) + (512*a^6*c^4*d^4)/(2*c*d^3 + d^4 + c^2*d^2) + (192*a^6*c^5*d^3)/(2*c
*d^3 + d^4 + c^2*d^2)) + (128*a^6*c^2*d^2*tan(e/2 + (f*x)/2))/((128*a^6*c^3*d^5)/(2*c*d^3 + d^4 + c^2*d^2) - (
512*a^6*c^2*d^6)/(2*c*d^3 + d^4 + c^2*d^2) - (320*a^6*c*d^7)/(2*c*d^3 + d^4 + c^2*d^2) + (512*a^6*c^4*d^4)/(2*
c*d^3 + d^4 + c^2*d^2) + (192*a^6*c^5*d^3)/(2*c*d^3 + d^4 + c^2*d^2))))/(d^2*f) + (a^2*atan(((a^2*(-(c + d)^3*
(c - d))^(1/2)*(c + 2*d)*((32*(a^4*c^4*d + a^4*c^2*d^3 + 2*a^4*c^3*d^2))/(2*c*d^3 + d^4 + c^2*d^2) - (32*tan(e
/2 + (f*x)/2)*(2*a^4*c*d^5 + 2*a^4*c^5*d - 8*a^4*c^2*d^4 - 4*a^4*c^3*d^3 + 4*a^4*c^4*d^2))/(2*c*d^4 + d^5 + c^
2*d^3) + (a^2*(-(c + d)^3*(c - d))^(1/2)*(c + 2*d)*((32*tan(e/2 + (f*x)/2)*(4*a^2*c*d^7 + 2*a^2*c^2*d^6 - 4*a^
2*c^3*d^5 - 2*a^2*c^4*d^4))/(2*c*d^4 + d^5 + c^2*d^3) - (32*(a^2*c*d^6 - a^2*c^3*d^4))/(2*c*d^3 + d^4 + c^2*d^
2) + (a^2*((32*(c^2*d^7 + 2*c^3*d^6 + c^4*d^5))/(2*c*d^3 + d^4 + c^2*d^2) + (32*tan(e/2 + (f*x)/2)*(3*c*d^9 +
6*c^2*d^8 + c^3*d^7 - 4*c^4*d^6 - 2*c^5*d^5))/(2*c*d^4 + d^5 + c^2*d^3))*(-(c + d)^3*(c - d))^(1/2)*(c + 2*d))
/(3*c*d^4 + d^5 + 3*c^2*d^3 + c^3*d^2)))/(3*c*d^4 + d^5 + 3*c^2*d^3 + c^3*d^2))*1i)/(3*c*d^4 + d^5 + 3*c^2*d^3
 + c^3*d^2) + (a^2*(-(c + d)^3*(c - d))^(1/2)*(c + 2*d)*((32*(a^4*c^4*d + a^4*c^2*d^3 + 2*a^4*c^3*d^2))/(2*c*d
^3 + d^4 + c^2*d^2) - (32*tan(e/2 + (f*x)/2)*(2*a^4*c*d^5 + 2*a^4*c^5*d - 8*a^4*c^2*d^4 - 4*a^4*c^3*d^3 + 4*a^
4*c^4*d^2))/(2*c*d^4 + d^5 + c^2*d^3) + (a^2*(-(c + d)^3*(c - d))^(1/2)*(c + 2*d)*((32*(a^2*c*d^6 - a^2*c^3*d^
4))/(2*c*d^3 + d^4 + c^2*d^2) - (32*tan(e/2 + (f*x)/2)*(4*a^2*c*d^7 + 2*a^2*c^2*d^6 - 4*a^2*c^3*d^5 - 2*a^2*c^
4*d^4))/(2*c*d^4 + d^5 + c^2*d^3) + (a^2*((32*(c^2*d^7 + 2*c^3*d^6 + c^4*d^5))/(2*c*d^3 + d^4 + c^2*d^2) + (32
*tan(e/2 + (f*x)/2)*(3*c*d^9 + 6*c^2*d^8 + c^3*d^7 - 4*c^4*d^6 - 2*c^5*d^5))/(2*c*d^4 + d^5 + c^2*d^3))*(-(c +
 d)^3*(c - d))^(1/2)*(c + 2*d))/(3*c*d^4 + d^5 + 3*c^2*d^3 + c^3*d^2)))/(3*c*d^4 + d^5 + 3*c^2*d^3 + c^3*d^2))
*1i)/(3*c*d^4 + d^5 + 3*c^2*d^3 + c^3*d^2))/((64*(2*a^6*c^3 - 4*a^6*c*d^2 + 2*a^6*c^2*d))/(2*c*d^3 + d^4 + c^2
*d^2) + (64*tan(e/2 + (f*x)/2)*(2*a^6*c^4 - 4*a^6*c*d^3 + 4*a^6*c^3*d - 2*a^6*c^2*d^2))/(2*c*d^4 + d^5 + c^2*d
^3) - (a^2*(-(c + d)^3*(c - d))^(1/2)*(c + 2*d)*((32*(a^4*c^4*d + a^4*c^2*d^3 + 2*a^4*c^3*d^2))/(2*c*d^3 + d^4
 + c^2*d^2) - (32*tan(e/2 + (f*x)/2)*(2*a^4*c*d^5 + 2*a^4*c^5*d - 8*a^4*c^2*d^4 - 4*a^4*c^3*d^3 + 4*a^4*c^4*d^
2))/(2*c*d^4 + d^5 + c^2*d^3) + (a^2*(-(c + d)^3*(c - d))^(1/2)*(c + 2*d)*((32*tan(e/2 + (f*x)/2)*(4*a^2*c*d^7
 + 2*a^2*c^2*d^6 - 4*a^2*c^3*d^5 - 2*a^2*c^4*d^4))/(2*c*d^4 + d^5 + c^2*d^3) - (32*(a^2*c*d^6 - a^2*c^3*d^4))/
(2*c*d^3 + d^4 + c^2*d^2) + (a^2*((32*(c^2*d^7 + 2*c^3*d^6 + c^4*d^5))/(2*c*d^3 + d^4 + c^2*d^2) + (32*tan(e/2
 + (f*x)/2)*(3*c*d^9 + 6*c^2*d^8 + c^3*d^7 - 4*c^4*d^6 - 2*c^5*d^5))/(2*c*d^4 + d^5 + c^2*d^3))*(-(c + d)^3*(c
 - d))^(1/2)*(c + 2*d))/(3*c*d^4 + d^5 + 3*c^2*d^3 + c^3*d^2)))/(3*c*d^4 + d^5 + 3*c^2*d^3 + c^3*d^2)))/(3*c*d
^4 + d^5 + 3*c^2*d^3 + c^3*d^2) + (a^2*(-(c + d)^3*(c - d))^(1/2)*(c + 2*d)*((32*(a^4*c^4*d + a^4*c^2*d^3 + 2*
a^4*c^3*d^2))/(2*c*d^3 + d^4 + c^2*d^2) - (32*tan(e/2 + (f*x)/2)*(2*a^4*c*d^5 + 2*a^4*c^5*d - 8*a^4*c^2*d^4 -
4*a^4*c^3*d^3 + 4*a^4*c^4*d^2))/(2*c*d^4 + d^5 + c^2*d^3) + (a^2*(-(c + d)^3*(c - d))^(1/2)*(c + 2*d)*((32*(a^
2*c*d^6 - a^2*c^3*d^4))/(2*c*d^3 + d^4 + c^2*d^2) - (32*tan(e/2 + (f*x)/2)*(4*a^2*c*d^7 + 2*a^2*c^2*d^6 - 4*a^
2*c^3*d^5 - 2*a^2*c^4*d^4))/(2*c*d^4 + d^5 + c^2*d^3) + (a^2*((32*(c^2*d^7 + 2*c^3*d^6 + c^4*d^5))/(2*c*d^3 +
d^4 + c^2*d^2) + (32*tan(e/2 + (f*x)/2)*(3*c*d^9 + 6*c^2*d^8 + c^3*d^7 - 4*c^4*d^6 - 2*c^5*d^5))/(2*c*d^4 + d^
5 + c^2*d^3))*(-(c + d)^3*(c - d))^(1/2)*(c + 2*d))/(3*c*d^4 + d^5 + 3*c^2*d^3 + c^3*d^2)))/(3*c*d^4 + d^5 + 3
*c^2*d^3 + c^3*d^2)))/(3*c*d^4 + d^5 + 3*c^2*d^3 + c^3*d^2)))*(-(c + d)^3*(c - d))^(1/2)*(c + 2*d)*2i)/(f*(3*c
*d^4 + d^5 + 3*c^2*d^3 + c^3*d^2))

________________________________________________________________________________________